package com.yonyou.isv.demo.openapi.api.project;

import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataResponse;
import com.yonyou.isv.demo.openapi.api.BaseOpenApi;
import com.yonyou.isv.demo.openapi.api.OpenApiURL;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class ProjectApi extends BaseOpenApi {
    public Map<String, Object> detail(Map<String, String> params) {
        ApiDataResponse apiDataResponse =  getForEntity(OpenApiURL.PROJECT_DETAIL,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String, Object> list(Map<String, Object> params) {
        ApiDataResponse apiDataResponse =  postForEntity(OpenApiURL.PROJECT_LIST,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String, Object> save(Map<String, Object> params) {
        ApiDataResponse apiDataResponse =  postForEntity(OpenApiURL.PROJECT_SAVE,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String, Object> enable(Map<String, Object> params) {
        ApiDataResponse apiDataResponse =  postForEntity(OpenApiURL.PROJECT_ENABLE,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String, Object> disable(Map<String, Object> params) {
        ApiDataResponse apiDataResponse =  postForEntity(OpenApiURL.PROJECT_DISABLE,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String, Object> delete(Map<String, Object> params) {
        ApiDataResponse apiDataResponse =  postForEntity(OpenApiURL.PROJECT_DELETE,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }

}
